//
//  ConverRecordCell.m
//  jingdongfang
//
//  Created by MTiMac01 on 2017/7/19.
//  Copyright © 2017年 JiongLiang Li. All rights reserved.
//

#import "ConverRecordCell.h"
#import "ChangCoinBillModel.h"

@interface ConverRecordCell ()
@property (weak, nonatomic) IBOutlet UILabel *converDateL;
@property (weak, nonatomic) IBOutlet UILabel *moneyL;
@property (weak, nonatomic) IBOutlet UILabel *converCodeL;

@end

@implementation ConverRecordCell

- (void)awakeFromNib
{
    [super awakeFromNib];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];
}

-(void)setModel:( ChangCoinBillModel*)model
{
    _model = model;
    NSDateFormatter* formatter = [[NSDateFormatter alloc] init];
    [formatter setDateStyle:NSDateFormatterFullStyle];
    [formatter setTimeStyle:NSDateFormatterFullStyle];
    [formatter setDateFormat:@"yyyy-MM-dd"];
    NSDate *confromTimesp = [NSDate dateWithTimeIntervalSince1970:[model.useTime longLongValue]];
    NSString *useTime = [formatter stringFromDate:confromTimesp];
//    self.converDateL.text = [NSString stringWithFormat:@"兑换日期: %@", useTime];
    self.converDateL.text = [NSString stringWithFormat:@"%@: %@", NSLocalizedString(@"Redeem Date", nil),useTime];

    self.moneyL.text = model.artcoin;
    
//    NSString *code = [model.serial substringFromIndex:model.serial.length- 12];
    
//    self.converCodeL.text = [NSString stringWithFormat:@"兑换码: %@ %@ %@ %@", model.title, [code substringWithRange:NSMakeRange(0,4)], [code substringWithRange:NSMakeRange(4,4)], [code substringWithRange:NSMakeRange(8,4)]];
//    self.converCodeL.text=[NSString stringWithFormat:@"礼品卡:%@", model.serial];
    self.converCodeL.text=[NSString stringWithFormat:@"%@:%@", NSLocalizedString(@"Gift Card", nil),model.serial];
}
@end
